Class: Graph

Graph()

Reads model.json to store structure of the graph, provides some methods to calculate the layout.

Constructor

new Graph()

Source:

Methods

calcInputDists()

Calculates distance to input node for each layer (gets cached in layer object).
Source:

calcOutputDists()

Calculates distance to output node for each layer (gets cached in layer object).
Source:

connectLayers(layerList)

Assignes inbound and outbound nodes to layers.
Parameters:
Name Type Description
layerList * list of layers from model.json
Source:

getLayoutByInputDist()

Returns dictonary of lists of layers, with distance to input as key.
Source:

getLayoutByOutputDist()

Returns dictonary of lists of layers, with distance to outpu as key.
Source:

getSortedLayerList()

Returns list of layers sorted by distance from input node.
Source:

initFromModelJson(modelJson)

Initialize data structures from json object.
Parameters:
Name Type Description
modelJson * json object from model.json file
Source:

initLayers(layerList)

Creates layer dictonary from layer list
Parameters:
Name Type Description
layerList * list of layers from model.json
Source:

setInputOutputLayers(layerList)

Assigns input and output layers.
Parameters:
Name Type Description
layerList * list of layers from model.json
Source: